#!/bin/bash
set -e
set -x
MYDIR="${0%/*}"
cd "$MYDIR/.."
source "recipes/common.sh"


# RECIPE START iproute2
# depends: elfutils

rm -rf build/iproute2
cp -a iproute2 build

make -j${JOBS} -C build/iproute2 \
	CC="${TARGET}-gcc" \
	HOSTCC="gcc" \
	LIBDIR="$prefix/${target_libdir}" \
	SBINDIR="$prefix/sbin" \
	NETNS_RUN_DIR=/run/netns \
	KERNEL_INCLUDE="`pwd`/kernel-headers/${LINUX_ARCH}$prefix/include" \
	LIBBPF_FORCE=off \
	${NIL}

make -j${JOBS} -C build/iproute2 \
	CC="${TARGET}-gcc" \
	HOSTCC="gcc" \
	LIBDIR="$prefix/${target_libdir}" \
	SBINDIR="$prefix/sbin" \
	NETNS_RUN_DIR=/run/netns \
	KERNEL_INCLUDE="`pwd`/kernel-headers/${LINUX_ARCH}$prefix/include" \
	LIBBPF_FORCE=off \
	install DESTDIR="$stage"

# RECIPE END iproute2
